#simple scenario:
#	1.	read data
#	2.	take only left breasts and cc images and cut the set to size of malignant cases
#	3.	train k-NN classifier
#	4.	perform a 10-fold evaluation
library(RWeka);
source("src/craftData.r");
source("src/unbindData.r");
#function definitions and libraries loaded.
#make sure readData has been executed
selectors=list(breast="left", img.type="cc");
trainData<-craftData(dataAll,"class",selectors);
trainData<-unbindData(trainData,names(info),c("class"));
classifier<-IBk(class~., data=trainData);
evaluate_Weka_classifier(classifier, numFolds=10)

results<-table(probToClass(predict(classifier, newdata=trainData, type=c("probability")), 0.99),trainData$class);
stats<-list(score=((results[1,1]+results[2,2])/sum(results)),
fp=results["benign","malignant"],fn=results["malignant","benign"])
print(stats);

